<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>主页 | 短信平台</title>
<jsp:include page="/WEB-INF/jsp/common/commonlist.jsp"></jsp:include>
<style>
	#userTable tr{
		background-color:white;
	}
	#userTable td{
		background-color:white;
	}
	
	td.td_title{
		width:80px;
	}
	
	.errorMsg{
		padding-top:9px;
		color:red;
		vertical-align: bottom;
	}
	.promptMsg{
		padding-left:40px;
		vertical-align: top;
	}
</style>
<script>
	function bodyLoad(){
		activeMenuItem("accountInfoItem","modifyInfoItem");
	}
	
	function submitForm(){
		$("#editUserForm").attr("action","doModifyUserInfo.do").submit();
		return false;
	}
	
	$(document).ready(function() {
		$("#editUserForm").validate({
			rules :{ 
				realName:{
		        	required : true,
		        	maxlength : 50
		        },
		        mobile:{
		        	required : true,
		        	number : true,
		        	maxlength : 11
		        },
		        phone:{
		        	number : true,
		        	maxlength : 11
		        },
		        email:{
		        	required : true,
		        	maxlength : 200
		        },
		        password:{
		        	required : true,
		        	maxlength : 100
		        },
		        confirmPassword:{
		        	required : true,
		        	maxlength : 100
		        },
		        birthday:{
		        	maxlength : 100
		        },
		        unit:{
		        	maxlength : 200
		        },
		        address:{
		        	required : true,
		        	maxlength : 100
		        },
		        note:{
		        	required : true,
		        	maxlength : 1000
		        }
			}
		});
	});
	
	$(document).ready(function() {
		$("#birthday").datepicker();	 
	}); 
</script>
</head>
<body onload="bodyLoad()">
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">短信平台</a></h1> 
      <!-- Logo (221px wide) -->
   
      <!-- Sidebar Profile links -->
     
     <!--  页面左上角的部分 -->
     <%@include file="/WEB-INF/jsp/common/leftTop.jsp" %>
     <!-- 页面左侧菜单部分 -->
     <%@include file="/WEB-INF/jsp/common/menu.jsp" %>
      
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    
   <%@ include file="/WEB-INF/jsp/common/top.jsp" %>
    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>修改资料</h3>
        <p class="errorMsg">${errorMsg}</p>
        
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab2">
          <form  id="editUserForm"   method="post"  onsubmit="return submitForm()">
          <input type="hidden" name="id" value="${user.userId }" />
           <table id="userTable">
            <tr>
              <td><label style="display: inline; width: 90px;">登录邮箱：</label></td>
              <td>${user.email } </td>              
              </tr>
            <tr>
           <tr>           
              <td class="td_title"><label style="display: inline; width: 90px;">真实姓名：</label></td>
              <td><input class="text-input small-input" type="text" id="realName" name="realName"  value="${user.realName }"/></td>              
            </tr>
            <tr>
              <td><label style="display: inline; width: 90px;">手机：</label></td>
              <td><input class="text-input small-input" type="text" id="mobile" name="mobile"  value="${user.mobile }"/></td>
             </tr>
            <tr>
              <td><label style="display: inline; width: 90px;">电话：</label></td>
              <td><input class="text-input small-input" type="text" id="phone" name="phone"  value="${user.phone }"/></td>              
             </tr>
           
            <td> <label style="display: inline; width: 90px;">生日：</label></td>
             <td><input class="text-input small-input" type="text" id="birthday" name="birthday"  value="${user.birthDay }"/></td>            
              </tr>
            <tr>
            	<td><label style="display: inline; width: 90px;">单位：</label></td>
              <td><input class="text-input medium-input datepicker" type="text" id="unit" name="unit"  value="${user.unit }"/></td>
			</tr>
			<tr>
			<td> <label style="display: inline; width: 90px;">地址：</label></td>
              <td><input class="text-input medium-input datepicker" type="text" id="address" name="address"  value="${user.address }"/></td>
			</tr>
            <tr>
            <td> <label style="display: inline;">性别：</label></td>
            <td>
            	<c:choose>
            		<c:when test="${user.sex eq '男' }">
            			<input type="radio" name="sex"  value="男" checked/>男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"/>女		
            		</c:when>
            		
            		<c:when test="${user.sex eq '女' }">
            			<input type="radio" name="sex"  value="男" checked/>男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"  checked/>女		
            		</c:when>
            		
            		<c:otherwise>
            			<input type="radio" name="sex"  value="男" />男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"/>女
            		</c:otherwise>
            	</c:choose>
              
              </td>
            </tr>
         
            <tr>
            	<td style="text-align: center;" colspan="2">
              		<input class="button" type="submit" value="保存用户信息" />
				</td>
			</tr>
           </table>
            <div class="clear"></div>
            <!-- End .clear -->
          </form>
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
    <div class="clear"></div>
    <%@ include file="/WEB-INF/jsp/common/copyright.jsp" %>
  </div>

</div>
</body>
</html>